{extend name="layout" /}

{block name="page-header"}{/block}

{block name="content"}

<div class="row">
    <div class="col-md-12">
        <div class="block">

            <div class="block-content tab-content">
                <div class="tab-pane active">
                    <div class="search-area border-b push">
                        <form action="{:url('ctom')}" class="form-horizontal row">

                            <div class="col-md-2 col-xs-12 push">
                                <div class="input-group">
                                    <span class="input-group-addon">公司状态</span>
                                    <select class="js-select2 form-control select2-hidden-accessible" id="query_type"
                                        name="query_type" data-width="resolve" data-allow-clear="true"
                                        data-placeholder="">
                                        <option value="open" {if condition="$query_type eq 'open'" } selected {/if}>开启
                                        </option>
                                        <option value="all" {if condition="$query_type eq 'all'" } selected {/if}>全部
                                        </option>
                                    </select>
                                </div>
                            </div>

                            <div class="col-md-2 col-xs-12 push">
                                <div class="input-group">
                                    <span class="input-group-addon">公司分类</span>
                                    <select class="js-select2 form-control select2-hidden-accessible" id="query_company"
                                        name="query_company" data-width="resolve" data-allow-clear="true"
                                        data-placeholder="">
                                        <option value="child" {if condition="$query_company eq 'child'" } selected
                                            {/if}>子公司</option>
                                        <option value="all" {if condition="$query_company eq  'all'" } selected {/if}>
                                            总公司</option>
                                    </select>
                                </div>
                            </div>

                            <div class="col-md-2 col-xs-12 push">
                                <div class="input-group">
                                    <span class="input-group-addon">查看公司</span>
                                    <select class="js-select2 form-control select2-hidden-accessible" id="child_company"
                                        name="child_company" data-width="resolve" data-allow-clear="true"
                                        data-placeholder="">
                                        <option value="">所有公司</option>
                                        {foreach name="all_company" item="vo" key="k" }
                                        <option value="{$k}" {if condition="$child_company eq $k" } selected {/if}>{$vo}
                                        </option>
                                        {/foreach}
                                    </select>
                                </div>
                            </div>

                            <div class="col-xs-1 col-sm-1 col-md-1 col-lg-1">
                                <div class="form-group">
                                    <div class="col-md-12">
                                        <button class="btn btn-sm btn-primary" type="submit"><i
                                                class="fa fa-search"></i> 搜索</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>

                    <div class="builder-table-wrapper" id="builder-table-wrapper">
                        <div class="builder-table" id="builder-table">

                            <div class="builder-table-body" id="builder-table-body">
                                <table
                                    class="table table-builder table-hover table-bordered table-striped js-table-checkable-target"
                                    id="builder-table-main">
                                    <colgroup>

                                    </colgroup>
                                    <tbody>

                                        {foreach name="now_data" item="vo" key="k" }
                                        <tr class="">
                                            <td class="">
                                                <font color="#5c90d2">
                                                    {$all_company[$k]}
                                                </font>
                                                {foreach name="vo" item="sub" key="subk" }
                                            <td class=" ">
                                                {:get_user_nickname($sub)}
                                            </td>
                                            {/foreach}
                                            </td>

                                        </tr>
                                        {/foreach}

                                    </tbody>
                                </table>
                            </div>

                            <div class="builder-table-right-header"></div>

                        </div>
                    </div>

                </div>
            </div>
        </div>

    </div>
</div>

<script src="__LIBS__/laydate/laydate.js"></script>
<script>
    var day = new Date();
    day.setTime(day.getTime());
    var time = day.getFullYear() + "-" + (day.getMonth() + 1) + "-" + day.getDate();
    //执行一个laydate实例
    laydate.render({
        elem: '#query_begin_time', //指定元素
        type: 'datetime'
    });
    laydate.render({
        elem: '#query_end_time', //指定元素
        type: 'datetime'
    })
</script>

{/block}

{block name="script"}

{/block}